package src.com.foreknow.demo9;

import src.com.foreknow.demo3.ControllDemo1;

//Math.random*10 % 3 +1
public class Computer {
    private  String name = "电脑";
    private int score = 0;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getScore() {
        return score;
    }

    public void setScore(int score) {
        this.score = score;
    }

    public int showFirst(){
        int choice = (int)(Math.random()*10)%3+1;
        switch (choice){
            case 1:
                System.out.println(getName()+"出拳:剪刀");
                break;
            case 2:
                System.out.println(getName()+"出拳:石头");
                break;
            case 3:
                System.out.println(getName()+"出拳:布");
                break;
        }

       return choice;
    }


    public static void main(String[] args) {
        Computer computer = new Computer();
        int num = computer.showFirst();
        System.out.println(num);
    }

}
